/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package ep.persistence.entities;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author Spyros
 */
@Entity
@Table(name = "t013_frequency", catalog = "epresc", schema = "")
@NamedQueries({
    @NamedQuery(name = "T013Frequency.findAll", query = "SELECT t FROM T013Frequency t"),
    @NamedQuery(name = "T013Frequency.findById", query = "SELECT t FROM T013Frequency t WHERE t.id = :id"),
    @NamedQuery(name = "T013Frequency.findByName", query = "SELECT t FROM T013Frequency t WHERE t.name = :name")})
public class T013Frequency implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Column(name = "name")
    private String name;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "t013Frequency", fetch = FetchType.LAZY)
    private Collection<T008Dosage> t008DosageCollection;

    public T013Frequency() {
    }

    public T013Frequency(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Collection<T008Dosage> getT008DosageCollection() {
        return t008DosageCollection;
    }

    public void setT008DosageCollection(Collection<T008Dosage> t008DosageCollection) {
        this.t008DosageCollection = t008DosageCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof T013Frequency)) {
            return false;
        }
        T013Frequency other = (T013Frequency) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return name;
    }

}
